import qs from 'qs';
import requests from "./request";
//业务请求列表
// 登录api
export const reqLogin=(param)=>requests({url:'user/login',method:'post',data:param})
//注册去除重复账号名
export const reqDuplicateRemoval=()=>requests({url:'user/getUserNameList',method:'get'})
//注册用户
export const reqCreateUser=(param)=>requests({url:'user/createUser',method:'post',params:param})
//获取用户信息
export const reqUserMessage=(param)=>requests({url:'user/getUserByName',method:'post',params:{username:param}})
//更新密码
export const reqUpdatePassword=(param)=>requests({url:'user/updatePassword',method:'post',data:param})
//更新用户信息
export const reqUpdateUserMessage=(param)=>requests({url:'user/updateUserMessage',method:'post',data:param})
//获取公告列表api
export const reqNotice=()=>requests({url:'notice/getNotices',method:'get'})
//根据条件获取可预约教室
export const reqRoomByCondition=(param)=>requests({url:'room/getRoomListByTime',method:'post',data:param})
//预约教室
export const reqBookingRoom=(param)=>requests({url:'room/insertBookingRecord',method:'post',data:param})
//获取教室列表
export const reqGetRoomList=()=>requests({url:'room/getRoomNoList',method:'get'})
//分页查询设备
export const reqEquipmentByPage=(param)=>requests({url:'equipment/getEquipmentListByPage',method:'post',params:param})
//获取报修列表
export const reqEquipmentRepairList=()=>requests({url:'equipment/getEquipmentRepairList',method:'get'})
//新建报修记录
export const reqCreateRepairRecord=(param)=>requests({url:'equipment/insertRepairReport',method:'post',params:param})
//删除报修记录
export const reqDeleteRepairRecord=(param)=>requests({url:'equipment/deleteRepairRecordByIds',method:'post',data: qs.stringify({ids: param }, { indices:false }, { charset: 'utf-8' })})
//导出报修记录为xls文件
export const reqDownloadFailRepairRecord=()=>requests({url:'equipment/downFileByRepairRecord',method:'get',responseType:'blob',headers:{'ContentType' : 'application/json'}})
//获取教师列表用于模糊查询
export const reqGetTeacherListByApplyProject=()=>requests({url:'project/getTeacherListByProject',method:'get'})
//项目申请
export const reqCreateProjectApply=(param)=>requests({url:'project/createProjectApply',method:'post',data:param,headers:{'ContentType':'multipart/form-data'}})
//获取教室预约列表
export const reqGetBookingRoomList=(param)=>requests({url:'room/getBookingRoomList',method:'get',params:param})
//获取项目-指导教师统计关系
export const reqGetTeacherPopularity=()=>requests({url:'project/getTeacherPopularityData',method:'get'})
//获取项目经费等级数据
export const reqGetProjectCostRank=()=>requests({url:'project/getCostRankData',method:'get'})
//获取项目以及其目前状态列表
export const reqGetProjectListWithState=()=>requests({url:'project/getProjectListWithState',method:'get'})

//系统设置相关请求列表
//获取公告列表
export const reqGetNoticeList=()=>requests({url:'_notice/getNoticeList',method:'get'})
//新建公告
export const reqCreateNotice=(param)=>requests({url:'_notice/insertNotice',method:'post',data:param})
//修改公告内容
export const reqUpdateNotice=(param)=>requests({url:'_notice/updateNoticeById',method:'post',data:param})
//删除公告
export const reqDeleteNoticeByIds=(param)=>requests({url:'_notice/deleteNoticeByIds',method:'post',data: qs.stringify({ids: param }, { indices:false }, { charset: 'utf-8' })})
//根据条件获取公告列表
export const reqGetNoticesByCondition=(param)=>requests({url:'_notice/getNoticesByCondition',method:'post',params:param})
//根据条件查询教室列表
export const reqGetRoomListByCondition=(param)=>requests({url:'_room/getRoomListByCondition',method:'post',params:param})
//获取教室所属楼宇列表
export const reqGetRoomLocationList=()=>requests({url:'_room/getRoomLocationList',method:'get'})
//新建教室记录
export const reqCreateRoom=(param)=>requests({url:'_room/insertRoom',method:'post',data:param})
//更新教室信息
export const reqUpdateRoomById=(param)=>requests({url:'_room/updateRoomById',method:'post',data:param})
//删除教室
export const reqDeleteRoomByIds=(param)=>requests({url:'_room/deleteRoomByIds',method:'post',data: qs.stringify({ids: param }, { indices:false }, { charset: 'utf-8' })})
//一键删除无效预约记录
export const reqDeleteBookingInvalid=(param)=>requests({url:'_room/deleteInvalidBookingRecord',method:'post',params:param})
//根据条件查询设备列表
export const reqGetEquipmentByCondition=(param)=>requests({url:'_equipment/getEquipmentByCondition',method:'post',params:param})
//创建设备记录
export const reqCreateEquipment=(param)=>requests({url:'_equipment/createEquipmentRecord',method:'post',data:param})
//根据主键更新设备信息
export const reqUpdateEquipmentById=(param)=>requests({url:'_equipment/updateEquipmentById',method:'post',data:param})
//根据主键数组删除设备记录
export const reqDeleteEquipmentByIds=(param)=>requests({url:'_equipment/deleteEquipmentByIds',method:'post',data: qs.stringify({ids: param }, { indices:false }, { charset: 'utf-8' })})
//根据时间一键更新报废设备状态
export const reqUpdateEquipmentStateByNowTime=(param)=>requests({url:'_equipment/updateEquipmentStateByNowTime',method:'post',params:param})
//根据条件查询符合的项目列表
export const reqGetProjectListByCondition=(param)=>requests({url:'_project/getProjectListByCondition',method:'post',params:param})
//获取项目——项目说明文件列表
export const reqGetProjectFileList=()=>requests({url:'_project/getProjectFileList',method:'get'})
//审核项目
export const reqExamineProject=(param)=>requests({url:'_project/updateProjectById',method:'post',params:param})
//获取被拒绝项目申请列表
export const reqGetInvalidProjectRecord=()=>requests({url:'_project/getInvalidProjectApplyList',method:'get'})
//根据主键删除无效项目申请
export const reqDeleteProjectMessageById=(param)=>requests({url:'_project/clearProjectMessageById',method:'post',params:param})
//获取过期项目列表
export const reqGetOverTimeProjectRecord=()=>requests({url:'_project/getOverTimeProjectRecord',method:'get'})
//根据主键删除过期项目记录
export const reqDeleteOverTimeProjectById=(param)=>requests({url:'_project/clearOverTimeProjectById',method:'post',params:param})

//系统权限模块
export const reqGetUserMessageList=()=>requests({url:'user/getUserMessageList',method:'get'})
//更新账户状态
export const reqUpdateAccountStateById=(param)=>requests({url:'user/updateUserAccountState',method:'post',params:param})
//更新账户角色
export const reqUpdateAccountRoleById=(param)=>requests({url:'user/updateUserRole',method:'post',params:param})
//注销账户
export const reqDeleteUserById=(param)=>requests({url:'user/deleteUserById',method:'post',params:param})

//删除指导教师
export const reqDeleteTeacherById=(param)=>requests({url:'_project/removeTeacherById',method:'post',params:param})
//新建指导教师
export const reqCreateTeacher=(param)=>requests({url:'_project/createTeacher',method:'post',data:param})
